<%-- 
    Document   : products
    Created on : 3 mai 2011, 10:22:18
    Author     : simon
--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:set var="view" value="/products" scope="session"/>

<div id="content">

    <div id="products">
        <c:forEach var="product" items="${productList}" varStatus="iter">

            <div class="item shadow white rounded" >

                <c:forEach items="${product.imageList}" var="image">
                    <c:if test="${ fn:contains(image.url, 'etiquette') }">
                        <img src="/ecom-web/icon/products/${image.url}" alt="image" />
                    </c:if>
                </c:forEach>

                <div>
                <c:choose>
                    <c:when test="${fn:length(product.name) > 15}">
                        <c:out value="${fn:substring(product.name, 0, 15)}" />...
                    </c:when>
                    <c:otherwise>
                        <c:out value="${product.name}" />
                    </c:otherwise>
                </c:choose>

                    <a href="<c:url value='product'><c:param name="idProduct" value="${product.idProduct}"/></c:url>" title=""><input type="button" value="View more" /></a>
                </div>
            </div>
        </c:forEach>
    </div>
</div>